{%insert header.tpl%}
{%if OrderAccepted%}
<div class="order-info">
	Ваш заказ принят!
</div>
{%insert orderaccepted.tpl%}
{%else%}
{%if IsCartEmpty%}
<div class="order-info">
	Ваша корзина пуста!
</div>
{%else%}
<h2>Форма заказа</h2>
	<form class="order-form" method="post" action="{% OrderUrl %}">
		<input type="hidden" name="method" value="Order" />
		<fieldset title="Контактные данные">
		<legend>Контактные данные</legend>
	{%if User%}
		{%with User%}
			<div class="fio">{% q < Name %}&nbsp;{% q < Patronymic %}&nbsp;{% q < Surname %}</div>
			<div class="e-mail"><span class="label">e-mail:</span>{% q < Email %}</div>
			<div class="mobile-phone"><span class="label">Номер мобильного телефона:</span>{% q < Mobile %}</div>
			<div class="address"><span class="label">Адрес доставки:</span>{% q < Address %}</div>
		{%endwith%}
	{%else%}
		{%iterate OrderProperties as property %}
		<div class="form-field{%odd%} odd{%endodd%}">
			{%ifnot Name `Comment`%}
			{%ifnot Name `Delivery`%}
			{%insert property.tpl%}
			{%endif%}
			{%endif%}
		</div>
		{%iterate%}
		<div class="form-field captcha"><span class="label">Введите символы с картинки:</span>&nbsp;<img id="captcha" class="captcha-image" src="{% CaptchaUrl %}" /><input type="text" class="captcha-value" name="captcha" value="" /><button type="button" class="captcha-refresher" title="{% i <  `Regenerate` %}" onclick="javascript:$(&quot;#captcha&quot;).attr(&quot;src&quot;,&quot;{% q <  CaptchaUrl %}&amp;rand=&quot;+Math.random());return false;">Обновить</button></div>
	{%endif%}	
		</fieldset>
		<fieldset title="Сумма заказа">
		<legend>Сумма заказа</legend>
		<div class="cart-sum"><span class="label">Выбрано товара на сумму:</span>{% CartCost %}&nbsp;руб.</div>
		<fieldset class="delivery-sum">
			<legend>Стоимость доставки</legend>
			{%assign dms DeliveryMethods%}
			{%assign totalcost CartCost%}
			{%with dms%}
			{%if ItemCount `1`%}
				<?php $this->_global_vars_['totalcost'] = $this->currentContext()->TotalCost; ?>
				<div><input type="hidden" name="Delivery" value="{% Code %}"/><span class="label">{% Name %}:</span>&nbsp;{% Cost %}&nbsp;руб.</div>
			{%else%}
			{%iterate context as dm%}
				<div><input type="radio" name="Delivery" value="{% Code %}" onclick="javascript:$(&quot;#total_cost&quot;).text(&quot;{% TotalCost %}&quot;);" /><span class="label">{% Name %}:</span>&nbsp;{% Cost %}&nbsp;руб.</div>			
			{%iterate%}
			{%endif%}
			{%endwith%}
		</fieldset>
		<div class="cart-sum"><span class="label">Всего с учетом доставки:</span><span id="total_cost">{% totalcost %}</span>&nbsp;руб.</div>
		</fieldset>
		<div class="comment">
				<span class="label">Дополнительная информация:</span>
				{%with Order%}
				<textarea name="Comment">{% Comment %}</textarea>
				{%endwith%}
		</div>
		<div class="btn-holder"><button type="button" class="btn-login" onclick="javascript:submit();">Заказать</button></div>
	</form>
{%endif%}
{%endif%}	
{%insert footer.tpl%}


